const db = wx.cloud.database()
Page({
  data: {
    boxlist: {},
  },

  onLoad: function (options) {
    db.collection('appbox').orderBy('order', 'asc').get().then(res => {
      this.setData({ boxlist: res.data })
    })
  },

  enterapplication: function (event) {
    var id = event.currentTarget.dataset.id
    switch (id) {
      case '通讯录':
        wx.navigateTo({ url: '../contact/contact' })
        break;
      case '添加人员':
        wx.navigateTo({ url: '../addperson/addperson' })
        break;
      case '删除人员':
        wx.navigateTo({ url: '../deleteperson/deleteperson'})
        break;
      default:
        break;
    }
  },
})